#!/usr/bin/env python3

def isSep(ch):
    return not ('a' <= ch <= 'z' or 'A' <= ch <= 'Z')


def countWord(s):
    count = 0
    for i, c in enumerate(s):
        if (i == 0 and not isSep(c)) or isSep(s[i - 1]) and not isSep(c):
            count += 1
    return count

def main():
    print("count = ", countWord(input("请输入字符串: ")))

if __name__ == "__main__":
    main()
